package thead;

/**
 * @ProjectName: interview
 * @Package: thead
 * @ClassName: TicketWindow
 * @Author: chenmengqi
 * @Description:
 * @Date: 2020/4/1 3:11 下午
 * @Version: 1.0
 */
public class TicketWindowRunable implements Runnable {
    //最多受理50笔业务
    private static final int MAX = 50;
    private int index = 1;


    @Override
    public void run() {
        while (index <= MAX) {
            System.out.println("柜台:" + Thread.currentThread().getName() + "当前的号码是:" + (index++));
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
